/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 26727
 * Date: 2024-01-11
 * Time: 18:48
 */
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        //        ***********请输入代码*************
        boolean isLegal = true;
        if(str.length() != 22 || str.substring(10,22).equals("@ctgu.edu.cn")) {
            isLegal = false;
        }
        else {
            for(int i = 0; i < 10; i++) {
                char ch = str.charAt(i);
                        if(Character.isDigit(ch) ||Character.isLetter(ch)) {
                            isLegal = true;
                        }
                        else {
                            isLegal = false;
                            break;
                        }
            }
        }
        if(isLegal) {
            System.out.println("合法邮箱");
        }
        else {
            System.out.println("不合法邮箱");
        }
        //        ************************
    }
}




